<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.zafu.dao.CartGoodsBean" %>
<%@ page import="com.zafu.entity.CartGoodsInfo" %><%--
  Created by IntelliJ IDEA.
  User: 86189
  Date: 2024/12/21
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    CartGoodsBean bean = new CartGoodsBean();
    ArrayList<CartGoodsInfo> data = bean.GetAll();
    StringBuilder  builder = new StringBuilder();
    out.println("<Cart>");
    Iterator<CartGoodsInfo> iter = data.iterator();
    while (iter.hasNext()) {
        CartGoodsInfo info = iter.next();
        builder.append(info.toString()).append("\n");
        out.println("<Good>");
        out.println("<image>" + info.getImage() + "</image>");
        out.println("<store>" + info.getStore() + "</store>");
        out.println("<price>" + info.getPrice() + "</price>");
        out.println("<name>" + info.getName() + "</name>");
        out.println("<info>" + info.getInfo() + "</info>");
        out.println("<count>" + info.getCount() + "</count>");
        out.println("<id>" + info.getId() + "</id>");
        out.println("</Good>");
    }
    out.println("</Cart>");
    System.out.printf(builder.toString());
%>
